//sizeof(d) = sizeof(b)+sizeof(c)-sizeof(a)+sizeof(dd)
#include <iostream>
using namespace std;

struct A {
  int aa;
  int aa2;
};

class B: public virtual A{
  int bb;
};

class C: virtual public A{
  int cc;
};

class D: public B,public C {
  int dd;
};

int main()
{
  A a;
  B b;
  C c;
  D d;
  cout<<"sizeof(A)\t"<<sizeof(a)<<endl; //8  int aa, aa2
  cout<<"sizeof(B)\t"<<sizeof(b)<<endl; //16 int aa, aa2, bb, vptr
  cout<<"sizeof(C)\t"<<sizeof(c)<<endl; //16 int aa, aa2, cc, vptr
  cout<<"sizeof(D)\t"<<sizeof(d)<<endl; //28 int aa, aa2, bb, cc, dd,vptr, vptr
}
